const http = require('http');
const url = require('url');
const fs = require('fs');

let server = http.createServer((request, response) => {
	console.log(request.url);
	
	fs.readFile(`..${request.url}`, (err, data) => {
		if (err) {
			response.write('404');
			response.end();
		} else {
			response.write(data);
			response.end();
		}
	})
})

server.listen(8080);